<template>
  <div class="flex" v-if="movie">
    <img :src="movie.mov_pic" alt="" srcset="" />
    <div class="movie" @mousedown="jump">
      <div>《{{ movie.mov_title }}》 豆瓣：{{ movie.mov_rating }}</div>
      <div>{{ movie.mov_text }}</div>
      <div>此刻·电影日历</div>
    </div>
  </div>
</template>
<script setup lang="ts">
import { http } from '@/utils/request'
import { ref } from 'vue'

let movie = ref()
http('cikeee?app_key=pub_23020990025').then((res: any) => {
  movie.value = JSON.parse(res)
})
function jump(e: any) {
  // let url=movie.value.mov_link
  let url = 'http://liben.online/videos/#/s?wd=' + movie.value.mov_title
  if (e.button === 0) {
    location.href = url
  }
  if (e.button === 1) {
    window.open(url)
  }
}
</script>
<style scoped>
.flex {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90%;
  gap: 8px;
}
.movie {
  cursor: pointer;
}
img {
  height: 82px;
}
</style>
